package com.gitee.wsl.security.digest

interface Digest {
     val digestSize: Int

     val blockSize: Int

     val algorithmName: String

     fun update(byte: Byte): Digest

     fun update(source: ByteArray, startIndex: Int = 0, endIndex: Int = source.size): Digest

     fun digest(): ByteArray

     fun digest(destination: ByteArray, destinationOffset: Int = 0)

     fun reset()
}

operator fun Digest.plusAssign(byteArray: ByteArray): Unit {
    update(byteArray)
}
